from django.urls import re_path


from splits import views

urlpatterns = [
    # re_path(r'^spit/', views.SpitView.as_view({
    #     'get': 'list',
    #     'post': 'create'
    # })),
    # re_path(r'^spit/(?P<pk>\d+)/', views.SpitView.as_view({
    #     'get': 'retrieve',
    # })),
    re_path(r'^spit/(?P<pk>\d+)/updatethumbup/$', views.ThumbupView.as_view()),
    re_path(r'^spit/(?P<pk>\d+)/collect/$', views.CollectView.as_view()),
    re_path(r'^spit/(?P<pk>\d+)/children/$', views.ContentView.as_view())
]

from rest_framework.routers import SimpleRouter
router = SimpleRouter()
# ② 注册视图集
router.register('spit', views.SpitView, basename='spit')
# ③ 添加url配置
urlpatterns += router.urls

